package com.voe;

public class AudioFrame {

	public static final int kMaxDataSizeSamples = 3840;

	enum VADActivity {
		kVadActive(0), kVadPassive(1), kVadUnknown(2);

		public static VADActivity fromValue(int value) {
			for (int i=0;i<VADActivity.values().length;i++) {
				if(VADActivity.values()[i].getValue() == value)
					return VADActivity.values()[i];
			}
			return null;
		}
		
		/**
		 * Constructor.
		 */
		private VADActivity(int value) {
			this.value = value;
		}

		/**
		 * Get the value.
		 * 
		 * @return the value
		 */
		public int getValue() {
			return value;
		}

		private final int value;
	};

	enum SpeechType {
		kNormalSpeech(0), kPLC(1), kCNG(2), kPLCCNG(3), kUndefined(4);

		public static SpeechType fromValue(int value) {
			for (int i=0;i<SpeechType.values().length;i++) {
				if(SpeechType.values()[i].getValue() == value)
					return SpeechType.values()[i];
			}
			return null;
		}
		
		/**
		 * Constructor.
		 */
		private SpeechType(int value) {
			this.value = value;
		}

		/**
		 * Get the value.
		 * 
		 * @return the value
		 */
		public int getValue() {
			return value;
		}

		private final int value;
	};


	public int id_;
	public int timestamp_;
	public short[] data_;
	public int samples_per_channel_;
	public int sample_rate_hz_;
	public int num_channels_;
	public SpeechType speech_type_;
	public VADActivity vad_activity_;
	public int energy_;
}
